package defpackage; import cn.wps.moffice.writer.core.TextDocument; import cn.wps.moffice.writer.io.writer.docx.DocxWriter; import defpackage.msj; import defpackage.msm; import defpackage.msn; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; /* renamed from: ofc reason: default package */ public final class ofc { private static int quB = 1; private static HashMap<Integer, Integer> quC = null; public static final Integer Vs(int i) { ew.assertNotNull("mCommentMap should not be null!", quC); return quC.get(Integer.valueOf(i)); } private static final void a(TextDocument textDocument, msm msm, ode ode, odf odf) throws IOException { ew.assertNotNull("textDoc should not be null!", textDocument); ew.assertNotNull("commentRef should not be null!", msm); ew.assertNotNull("w should not be null!", odf); mgh mgh = (mgh) textDocument.Oe(3); ew.assertNotNull("commentDoc should not be null!", mgh); msn msn = mgh.oQt; ew.assertNotNull("commentTxt should not be null!", msn); msj.f fVar = msn.pjm; ew.assertNotNull("commentTxtHeadNode should not be null!", fVar); odf.i("w:comments", "xmlns:w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main", "xmlns:wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships", "xmlns:v", "urn:schemas-microsoft-com:vml", "xmlns:w10", "urn:schemas-microsoft-com:office:word", "xmlns:o", "urn:schemas-microsoft-com:office:office", "xmlns:wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing", "xmlns:w14", "http://schemas.microsoft.com/office/word/2010/wordml", "xmlns:mc", "http://schemas.openxmlformats.org/markup-compatibility/2006", "xmlns:m", "http://schemas.openxmlformats.org/officeDocument/2006/math", "xmlns:wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape", "xmlns:wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup", "xmlns:wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk", "xmlns:wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas", "mc:Ignorable", "w14 wp14"); msj.g dOv = msm.dOv(); while (dOv.hasNext()) { msm.d dVar = (msm.d) dOv.dOx(); msn.a aVar = dVar.oSW; ew.assertNotNull("commentDoc should not be null!", mgh); ew.assertNotNull("refNode should not be null!", dVar); ew.assertNotNull("txtNode should not be null!", aVar); ew.assertNotNull("commentTxtHeadNode should not be null!", fVar); ew.assertNotNull("w should not be null!", odf); ArrayList<String> arrayList = new ArrayList<>(); int i = quB; quB = i + 1; arrayList.add("w:id"); arrayList.add(Integer.toString(i)); String str = dVar.author; if (str != null) { arrayList.add("w:author"); arrayList.add(str); } myw myw = dVar.oSM; if (myw != null) { arrayList.add("w:date"); arrayList.add(ogi.b(myw)); } String str2 = dVar.oSL; if (str2 != null) { arrayList.add("w:initials"); arrayList.add(str2); } odf.d("w:comment", arrayList); int dOw = aVar.dOw(); msj.h dOG = aVar.dOG(); int length = dOG.equals(fVar) ? mgh.getLength() : dOG.dOw(); ew.eH(); quC.put(Integer.valueOf(dOw), Integer.valueOf(i)); DocxWriter.aX(3, dOw, length).hF(dOw, length); ode.qtb = ode.qta.get(dVar); DocxWriter.a(mgh, dOw, length, 0, odf, 3); ode.qtb = null; odf.endElement("w:comment"); } odf.endElement("w:comments"); } public static void a(ode ode, odf odf) throws IOException { ew.assertNotNull("dctx should not be null!", ode); ew.assertNotNull("w should not be null!", odf); TextDocument textDocument = ode.pxJ; ew.assertNotNull("textDoc should not be null!", textDocument); mdl dDT = textDocument.dDT(); ew.assertNotNull("mainDoc should not be null!", dDT); msm dEp = dDT.dEp(); if (dEp != null) { if (quC == null) { quC = new HashMap<>(); } a(textDocument, dEp, ode, odf); } } public static void dispose() { quB = 1; if (quC != null) { quC.clear(); } } }